import Vue from "vue";
import VueRouter from "vue-router";
import Home from "@/views/home";
import AppGoods from "@/views/AppGoods";
import AppUsers from "@/views/AppUsers";
import AppOrders from "@/views/AppOrders";
import AppShops from "@/views/AppShops";
import reg from "@/views/reg"
import login from "@/views/login"
Vue.use(VueRouter);

const routes = [
    {
      name:'reg',
      path:'/reg',
      component: reg
    },
    {
      name:'login',
      path:'/login',
      component:login
    },
    {
      name:'home',
      path:'/home',
      component:Home,
      children:[
        {
          path:'goods',
          name: 'goods',
          component: AppGoods
        },
        {
          path:'users',
          name: 'users',
          component: AppUsers
        },
        {
          path:'orders',
          name: 'orders',
          component: AppOrders
        },
        {
          path:'shops',
          name: 'shops',
          component: AppShops
        },
      ] 
    }
];

const router = new VueRouter({
  routes
});

export default router;
